Skip to content

Conversation

@Cirilla-zmh
Copy link
Member

Fixes #2721 #1835

Changes

Add JSON schema definition for gen_ai.tool.definitions.

Important

Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@Cirilla-zmh Cirilla-zmh requested review from a team as code owners October 20, 2025 11:45
@Cirilla-zmh Cirilla-zmh moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Oct 20, 2025
Change-Id: Ib6133b3019195e4fa9a54d329ff4b891a281d208
Co-developed-by: Cursor <[email protected]>
@Cirilla-zmh Cirilla-zmh force-pushed the minghui/tool_definitions branch from 76f99f0 to 2a15973 Compare October 20, 2025 12:46
@github-actions github-actions bot added enhancement New feature or request area:gen-ai labels Oct 20, 2025
@Cirilla-zmh
Copy link
Member Author

This is the continued PR of #2793

Change-Id: Ie116f8bcb9e758b026596b797569b27496b35521
Co-developed-by: Cursor <[email protected]>
format is not supported and SHOULD be recorded in structured form otherwise.

If instrumentations can reliably deserialize and extract the tool definitions,
it's RECOMMENDED to only populate required fields (`name`, `type`) of the definition
Copy link
Member Author

@Cirilla-zmh Cirilla-zmh Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether we need to capture 'name' & 'type' by default, considering they are important informations and have no sensitive/huge content? cc @ShipraJain01 @lmolkova

Here is a prototype from spring-ai instrumentation:

options.getToolCallbacks().stream()
    .map(
        toolCallback -> {
          String name = toolCallback.getToolDefinition().name();
          String type = "function";
          if (messageCaptureOptions.captureMessageContent()) {
            return ToolDefinition.create(
                type, name, toolCallback.getToolDefinition().description(), toolCallback.getToolDefinition().getArguments());
          } else {
            return ToolDefinition.create(type, name, null, null);
          }
        })
    .filter(Objects::nonNull)
    .forEach(toolDefinitions::append);

Change-Id: If96268fc1b4d3cd64c0a10437a968cbe5ec83d98
Co-developed-by: Cursor <[email protected]>
Change-Id: Ic5480fbdb1058a2e1ace084c8ce3735484f91c06
Co-developed-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gen-ai enhancement New feature or request

Projects

Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

Define schema for Tool Definitions for Single and Multi-Agent Spans

4 participants